package com.tengju.user.domain.model.survey;

import lombok.Value;

import java.math.BigDecimal;

@Value
public class SurveyMeta {

    private SurveyId id;

    private String title;

    private String desc;

    private Integer itemNumLimit;

    private BigDecimal passScore;

    private SurveyShuffleStatusEnum shuffle;

    private SurveyTypeEnum type;


    public boolean checkScore(BigDecimal examScore) {
        if (passScore == null) {
            return true;
        }
        if (examScore == null) {
            return false;
        }
        return passScore.compareTo(examScore) <= 0;
    }
}